#!/user/bin/env python
# coding:utf-8

import re

if __name__ == "__main__":
    # [a-z]+
    # str1 = "asdasdasda"
    # res = re.match("[a-z]+",str1)
    # print(res)

    # preg = re.compile("[a-z]+")
    # str1 = "asdasdasda"
    # a = preg.search(str1)
    # print(a)


    # group 分组
    # str1 = "12312hhgfdhfas12312dsagdjag213gjdsasd"
    # preg = re.compile("(\d+)(\w+)(\d+)(\w+)(\d+)(\w+)")
    # a =  preg.search(str1)
    # print a.group(1)

    # 字符串
    str1 = "这是一个13126858018测试的文件1052430943@qq.comdsada.hahadasd12312321312dsa打算大1830000000000多"
    preg = re.compile("((?:13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8})")
    a = preg.findall(str1)
    print a
